package casa.depesos.app.com.http.parser;

import android.text.TextUtils;

import com.common.base.utils.SPHelper;

import casa.depesos.app.com.App;
import casa.depesos.app.com.http.BaseParser;
import casa.depesos.app.com.http.bean.ProgressBean;
import casa.depesos.app.com.utils.Constant;

public class ProgressParser extends BaseParser<ProgressBean> {

    @Override
    public ProgressBean parseData(ProgressBean value) {
        ProgressBean bean = super.parseData(value);
        if (bean != null && bean.data != null && bean.isValid()) {
            if (!TextUtils.isEmpty(bean.data.applyId)) {
                Constant.setApplyId(bean.data.applyId);
                SPHelper.getInstance(App.getApp()).putStringAndCommit("apply", Constant.getApplyId());
            }
        }
        return bean;
    }
}
